package com.kfm.base.io.b;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo03 {

    public static void main(String[] args) {
        // 1. 创建源
        // 2. 选择流
        // 3. 操作
        // 4. 释放资源
        try (FileInputStream fis = new FileInputStream("d:/io/file-input.txt")){

            byte[] bytes = fis.readAllBytes();
            System.out.println(new String(bytes));

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
